package com.codi.bus.core.fund.dao.impl;

import com.codi.base.dao.v2.GeneratedBaseDaoImpl;
import com.codi.bus.core.domain.PortfolioFundOrder;
import com.codi.bus.core.domain.TradeOrder;
import com.codi.bus.core.fund.dao.FundPortfolioTransferDao;
import com.codi.bus.core.fund.domain.FundPortfolioTransfer;
import com.codi.bus.core.vo.query.PortfolioFundOrderQueryVo;
import com.github.pagehelper.PageRowBounds;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 模块名
 *
 * @author spy
 * @version 1.0 2018-01-30
 * @since 1.0
 */
@Slf4j
@Repository
public class FundPortfolioTransferDaoImpl extends GeneratedBaseDaoImpl<FundPortfolioTransfer> implements FundPortfolioTransferDao {
    @Override
    public List<FundPortfolioTransfer> select(FundPortfolioTransfer record) {
        return this.findList(generateStatement("select"), record);
    }

    @Override
    public List<FundPortfolioTransfer> query(PortfolioFundOrderQueryVo record) {

        return this.getSqlSession().selectList(generateStatement("query"), record);
    }

    @Override
    public void updateStatus(FundPortfolioTransfer entity) {
        entity.setLastUpdateDate(new Date());
        this.update(FundPortfolioTransfer.class.getName() + ".updateStatus", entity);
    }
}
